﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace PerpheralDevice.Units;
/// <summary>
///  物理输入开关基类
/// </summary>
public abstract class SwitchRO : Switch {

    private MockEnum mfMockEnum = MockEnum.Shut;
    public SwitchRO MockIDSet(int mockID) {
        this.mfMockEnum = (MockEnum)mockID;
        return this;
    }

    protected bool? GenMockValue() {
        bool? retValue = null;
        if (this.PerpDev.IsMocking) {
            retValue = SwitchROMocker.GenValue(this.mfMockEnum);
            if (this.IsOpen != retValue) {
                this.IsOpen = retValue;
                this.OnStatusChangedRaise();
            }
        }
        return retValue;
    }

}
